package com.elder.common.enums;

import java.util.HashMap;
import java.util.Map;

public enum RoomType {

    /**  房间状态**/
    ROOM_STOP(201,"ROOM_STOP","停用"),

    ROOM_FULL(202,"ROOM_FULL","满员"),

    ROOM_NOT_FULL(203,"ROOM_NOT_FULL","未住满"),

    ROOM_WH(204,"ROOM_WH","维护");

    private Integer value;
    private String displayName;
    private String cnName;

    RoomType(Integer value, String displayName, String cnName){
        this.value = value;
        this.displayName = displayName;
        this.cnName = cnName;
    };

    private static Map<Integer, String> displayNameMap = new HashMap<Integer, String>();
    private static Map<String, Integer> valueMap = new HashMap<String, Integer>();
    public static Map<Integer, String> cnNameMap = new HashMap<Integer, String>();

    static{
        for(RoomType artsOrScience : RoomType.values()){
            displayNameMap.put(artsOrScience.value, artsOrScience.getDisplayName());
            valueMap.put(artsOrScience.getDisplayName(), artsOrScience.value);
            cnNameMap.put(artsOrScience.value, artsOrScience.getCnName());
        }
    }

    public static String getDisplayName(Integer value){
        return displayNameMap.get(value) == null? "": displayNameMap.get(value);
    }

    public static String getCnName(Integer value){
        return cnNameMap.get(value) == null? "": cnNameMap.get(value);
    }

    public static Integer getValue(String displayName){
        return valueMap.get(displayName);
    }

    public Integer getValue() {
        return value;
    }

    public String getDisplayName() {
        return displayName;
    }

    public String getCnName() {
        return cnName;
    }
}
